package cn.wjh.business.domain;

import cn.wjh.business.handle.ListIntToListLongTypeHandler;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import com.ruoyi.common.core.domain.entity.SysUser;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.Date;
import java.util.List;

/**
 * 比赛对象 tbl_competition
 *
 * @author jiraWu
 * @date 2023-10-17
 */
@EqualsAndHashCode(callSuper = true)
@Data
@TableName(value = "tbl_competition",autoResultMap = true)
public class Competition extends BaseEntity {
	private static final long serialVersionUID = 1L;


	/**
	 * 主键
	 */
	@TableId
	private Long competitionId;


	/**
	 * 标题
	 */
	@Excel(name = "标题")
	private String title;


	/**
	 * 比赛简介
	 */
	@Excel(name = "比赛简介")
	private String description;

	/*创建人Id*/
	private Long userId;

	/**
	 * 封面
	 */
	@Excel(name = "封面")
	private String cover;


	/**
	 * 比赛开始时间
	 */
	@JsonFormat(pattern = "yyyy-MM-dd")
	@Excel(name = "比赛开始时间", width = 30, dateFormat = "yyyy-MM-dd")
	private Date startTime;


	/**
	 * 比赛结束时间
	 */
	@JsonFormat(pattern = "yyyy-MM-dd")
	@Excel(name = "比赛结束时间", width = 30, dateFormat = "yyyy-MM-dd")
	private Date endTime;


	/**
	 * 报名开始时间
	 */
	@JsonFormat(pattern = "yyyy-MM-dd")
	@Excel(name = "报名开始时间", width = 30, dateFormat = "yyyy-MM-dd")
	private Date signStartTime;


	/**
	 * 报名结束时间
	 */
	@JsonFormat(pattern = "yyyy-MM-dd")
	@Excel(name = "报名结束时间", width = 30, dateFormat = "yyyy-MM-dd")
	private Date signEndTime;


	/**
	 * 浏览数量
	 */
	@Excel(name = "浏览数量")
	private Long views;


	/**
	 * 0正常 2删除
	 */
	private String delFlag;


	/**
	 * 创建时间
	 */
	private Date createTime;


	/**
	 * 更新时间
	 */
	private Date updateTime;


	/**
	 * 创建人
	 */
	private String createBy;


	/**
	 * 修改人
	 */
	private String updateBy;


	/**
	 * 部门Id
	 */
	@Excel(name = "部门Id")
	private Long deptId;


	/**
	 * 备注
	 */
	@Excel(name = "备注")
	private String remark;

	/*评委Id列表*/
	@TableField(typeHandler = ListIntToListLongTypeHandler.class,value="judge_ids")
	private List<Long> judgeIds;
	/*评委*/
	@TableField(exist = false)
	private List<SysUser> judges;

	/*收藏数量*/
	@TableField(exist = false)
	private Long collect = 0L;

	/*是否已经提交作品*/
	@TableField(exist = false)
	private Boolean isPublishWorks=false;
}

